/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.inventario.modelo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author ctrosch
 */
@Entity
@Table(name = "stttph")
public class ST_TipoProducto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name="STTTPH_TIPPRO", length=6)
    private String tippro;

    @Column(name="STTTPH_DESCRP", length=60)
    private String descrp;

    @Column(name="STTTPH_STOCKS",length=1)
    private String stocks;

    @Column(name="STTTPH_DEBAJA",length=1)
    private String debaja;

    @OneToMany(mappedBy = "tipoProducto", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
    private List<ST_Rubro01> rubro01;

    @OneToMany(mappedBy = "tipoProducto", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
    private List<ST_Rubro02> rubro02;

    public String getTippro() {
        return tippro;
    }

    public void setTippro(String tippro) {
        this.tippro = tippro;
    }

    public String getDescrp() {
        return descrp;
    }

    public void setDescrp(String descrp) {
        this.descrp = descrp;
    }

    public String getStocks() {
        return stocks;
    }

    public void setStocks(String stocks) {
        this.stocks = stocks;
    }

    public String getDebaja() {
        return debaja;
    }

    public void setDebaja(String debaja) {
        this.debaja = debaja;
    }

    public List<ST_Rubro01> getRubro01() {
        return rubro01;
    }

    public void setRubro01(List<ST_Rubro01> rubro01) {
        this.rubro01 = rubro01;
    }


    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ST_TipoProducto other = (ST_TipoProducto) obj;
        if ((this.tippro == null) ? (other.tippro != null) : !this.tippro.equals(other.tippro)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        return hash;
    }
    
    @Override
    public String toString() {
        return "tv.producto.modelo.TipoProducto[id=" + tippro + "]";
    }

}
